/*****************************************************************
 MYD Engine v0.1

 File: myd_entity2d.h
 Created: 12/06/09
*****************************************************************/

#ifndef MYD_ENTITY2D_H
#define MYD_ENTITY2D_H

#include "system/myd_system.h"

namespace myd
{
	class Renderer;

	class MYD_API Entity2d
	{
		//const & dest
		public:
			Entity2d(void);
			virtual ~Entity2d(void){};
		
			//properties
			void setName(std::string kName);
			const std::string& getName() const;
			bool isMoving;
		
			//position / rotation / dimension
			void setPos (float fX, float fY, float fZ);
			float getPosX() const;
			float getPosY() const;
			float getPosZ() const;

			void setRotation(float fRotation);
			float getRotation() const;

			void setDim(float fW, float fH);
			float getWidth() const;
			float getHeight() const;

			//methods
			virtual void draw(Renderer& tm_renderer) const;
			virtual void update(float fTimeBetweenFrames);

			//collision
			void setCollisionable(bool set);
			virtual void onCollide(Entity2d* tm_entity) = 0;

		private:
			std::string m_kName;
		
		//movement / transform
		public:
			void setSpeed(float speed);
			void setAngle(float angle);
			void setMoving(bool);
			
		private:
			float m_fX, m_fY, m_fZ;
			float m_fW, m_fH;
			float m_fRotation;
			float m_fMovAngle, m_fMovAngleRad;
			float m_fMovSpeed;
		
		public:
			bool isCollisionable;

	};
	#include "myd_entity2d.inl"
}//end namespace
#endif //MYD_ENTITY2D_H
